import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from '@/store/index';
// 定义全局组件
import TypeNav from "@/components/TypeNav";
import Carsousel from "@/components/Carsousel";
import Pagination from "@/components/Pagination";
//统一接口api文件夹里面全部请求函数
//统一引入
import * as API from '@/api';
// 13700000000 111111

Vue.config.productionTip = false
// 全局组件：第一个参数：组件名字 第二个参数：组件
Vue.component(TypeNav.name, TypeNav);
Vue.component(Carsousel.name, Carsousel);
Vue.component(Pagination.name, Pagination);
// 按需引入lElementUI
import { MessageBox, Form, FormItem, Input, Button, Checkbox } from 'element-ui';
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Button)
Vue.use(Checkbox)
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

import cxk from '@/assets/lazy-img.jpg';
//引入插件
import VueLazyload from 'vue-lazyload';
//注册插件
Vue.use(VueLazyload, {
  //懒加载默认的图片
  loading: cxk
});
// 引入MockServer.js-----mock数据
import "@/mock/mockServer"
// 引入swiper样式
import "swiper/css/swiper.css"
new Vue({
  render: h => h(App),
  // 全局事件总线$bus配置
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  router,
  store
}).$mount('#app')
